Repository navigation
haskell: load the mingw cc toolchain rules from rules_cc on Bazel 9 (closes #8969) - #8976
Merged
Merged
Conversation
…loses #8969) The Windows GHC repo loaded @rules_cc//cc:cc_toolchain.bzl, which does not exist in rules_cc 0.2.27, and rules_haskell's cc_toolchain_config used the native CcToolchainConfigInfo global, which is None under Bazel 9. Load cc_toolchain from cc/toolchains, patch rules_haskell to load the provider from rules_cc (tweag/rules_haskell#2484), and add a Linux build test that uses the same loads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hzpb4qWNZKpDCrwUz7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8969
Part of #8733 (the msvc clang_tidy/clang_syntax real_result targets still need a green Windows run, which this PR's evidence run provides).
What changed
haskell/toolchain/repos.bzl:_MINGW_CC_LOADSloadscc_toolchainfrom@rules_cc//cc/toolchains:cc_toolchain.bzl. rules_cc 0.2.27 has nocc/cc_toolchain.bzl.patches/rules_haskell/cc_toolchain_config_info.patch(new, registered inpatches/rules_haskell/BUILD.bazeland therules_haskellpatches list):haskell/cc_toolchain_config.bzlloadsCcToolchainConfigInfofrom rules_cc. The native global isNoneunder Bazel 9. The patch is kept separate fromhermetic_haskell.patchso it can be dropped once upstream merges the fix: cc_toolchain_config.bzl fails to load under Bazel 9: CcToolchainConfigInfo is None tweag/rules_haskell#2483 (issue), Load CcToolchainConfigInfo from rules_cc in cc_toolchain_config.bzl tweag/rules_haskell#2484 (PR).haskell/tests/mingw_cc/BUILD.bazel(new): abuild_testover acc_toolchain_configand acc_toolchainthat use the same two loads. It runs on Linux, where the Windows GHC repo is an incompatible stub. The test is not taggedmanual.Tests
tools/dx test //haskell/tests/mingw_cc:all //haskell/toolchain:all //patches/rules_haskell:all: 2 tests pass.//haskell/tests/mingw_cc:allfails to load withError in rule: at index 0 of provides, got element of type NoneType, want Provider, the same error as evidence run 42309468960.--mode=check --lint=warnis clean on the changed files.MODULE.bazel.lockis unchanged.tools/dx check --applyfailed while building quality tools (Failed to fetch blobs because of a remote cache error, still failing with--remote_cache= --noremote_accept_cached).--affectedalso could not run because the shared clone'sorigin/HEADpoints at a nonexistentorigin/master. Instead I ran tests on the explicit targets above. Nested-Bazel and consumer tests were not run locally; CI covers them.Evidence
--//cc/toolchains:compiler=msvc: run 42323331884. Scope: the 3 quality: clang-tidy on MSVC actions runs without the MSYS no-conversion env, so bash rewrites /I and /D flags into paths #8733 msvc real_result targets and//haskell/tests/mingw_cc:mingw_cc_test.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hzpb4qWNZKpDCrwUz7